package fr.afcepf.ai85.gepeto.ds;

import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import javax.sql.DataSource;

public class BasicDataSource implements DataSource{
	
	@Override
	public Connection getConnection() throws SQLException {
		Connection cn=null;
		try {
			String urlDB="jdbc:mysql://localhost/gepeto_db";
			String username="root"; 
			String pwd = "afcepf";
			Class.forName("com.mysql.jdbc.Driver");
			cn= DriverManager.getConnection(
					 urlDB,username,pwd);
		} catch (Exception e) {
				e.printStackTrace();
		}
		return cn;
	}
	@Override
	public PrintWriter getLogWriter() throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int getLoginTimeout() throws SQLException {
		// TODO Auto-generated method stub
		return 0;
	}

	
	

	@Override
	public void setLogWriter(PrintWriter arg0) throws SQLException {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void setLoginTimeout(int arg0) throws SQLException {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean isWrapperFor(Class<?> arg0) throws SQLException {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public <T> T unwrap(Class<T> arg0) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	

	@Override
	public Connection getConnection(String arg0, String arg1)
			throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

}
